﻿/* 提供富文本编辑器样式，内容可写 */
//正文

KindEditor.ready(function (K) {
    var editor = K.create('#Content', {
        cssPath: '../KindEditor/plugins/code/prettify.css',
        uploadJson: '../../Attached/upload_json.ashx',
        fileManagerJson: '../../Attatched/file_manager_json.ashx',
        allowFileManager: false,
        autoHeightMode: true,
        afterCreate: function () {
            this.loadPlugin('autoheight');
        },
        width: '100%',
        items: [
            'bold', 'italic', 'underline', '|', 'fontname', 'fontsize', 'forecolor', 'hilitecolor', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                'insertunorderedlist', '|', 'paste', 'plainpaste', 'wordpaste', '|', 'emoticons', 'link', 'image', 'insertfile'
        ]
        //afterCreate : function() {
        //    var self = this;
        //    K.ctrl(document, 13, function() {
        //        self.sync();
        //        K('form[name=create]')[0].submit();
        //    });
        //    K.ctrl(self.edit.doc, 13, function() {
        //        self.sync();
        //        K('form[name=create]')[0].submit();
        //    });
        //}
    });
    prettyPrint();
});

//回复
KindEditor.ready(function (K) {
    var editorRespond = K.create('#RespondContent', {
        cssPath: '../KindEditor/plugins/code/prettify.css',
        uploadJson: '../../Attached/upload_json.ashx',
        fileManagerJson: '../../Attatched/file_manager_json.ashx',
        allowFileManager: false,
        autoHeightMode: true,
        afterCreate: function () {
            this.loadPlugin('autoheight');
        },
        width: '100%',
        items: [
            'bold', 'italic', 'underline', '|', 'fontname', 'fontsize', 'forecolor', 'hilitecolor', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                'insertunorderedlist', '|', 'paste', 'plainpaste', 'wordpaste', '|', 'emoticons', 'link', 'image', 'insertfile'
        ]
    });
});







//var editor;
//KindEditor.ready(function (K) {
//    editor = K.create('textarea[name="Content"]', {
//        resizeType: 1,
//        allowPreviewEmoticons: false,
//        allowImageUpload: false,
//        items: [
//            'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
//            'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
//            'insertunorderedlist', '|', 'emoticons', 'image', 'link']
//    });
//});